<?php
defined('BASEPATH') OR exit('No direct script access allowed');
 
class Index extends AdminTwoController {

	function __construct() {
		parent::__construct();
		$this -> sidebar = "Index";
		// $this->load->library('session');
		 $this->load->database(); // 加载数据库库
	}

	function Index() {	
		if(!isset($_SESSION[SESS_USER])){
			$this->load->view('admin/login');
		}else{
			$this->load->view('admin/index');
		}
		  
	}
	function desktop(){
		$this->load->model('Supervisor_feedback_model');

		$user_id = $this->input->get('user_id');
		$query = $this->db->get_where('admin', array('id' => $user_id));

		$user = $query->row_array();
        // 返回单行结果
		$_SESSION[SESS_USER]=$user;
		// if($user){
		// 	$role=explode(',',$user['sub_role_id']);
		// 	array_push($role,$user->role_id);
		// 	$_SESSION[SESS_USER]=$user;

		// } else {
			$role=explode(',',getSess()['sub_role_id']);
			array_push($role,getSess()['role_id']);
		// }
		
		


		// foreach ($role as $k => $v) {

			// pri(WebRole::Manage[XPHEnum::Value]);
			// pri($_SESSION[SESS_USER]);
			// exit;
		if(in_array(WebRole::Manage[XPHEnum::Value],$role)){//13
			
				$data['feedbackcount']=$this->Supervisor_feedback_model->query('select count(*)as count from(select * from db_student_feedback union all select * from db_supervisor_feedback) feedback where role_belong='.WebRole::Manage[XPHEnum::Value].' and status='.FeedBackStatus::ToAudit[XPHEnum::Value].' and belong=0 and del_flag='.CommonStatus::UnDeleted[XPHEnum::Value]);
				// pri($data['feedbackcount']);

				$feedback_list = $this->Supervisor_feedback_model->query('select * from(SELECT db_student_feedback.*,a.role_id,a.sub_role_id FROM db_student_feedback LEFT JOIN db_admin a on a.id = db_student_feedback.creator UNION ALL SELECT db_supervisor_feedback.*,a1.role_id,a1.sub_role_id FROM db_supervisor_feedback LEFT JOIN db_admin a1 on a1.id = db_supervisor_feedback.creator) feedback where role_belong='.WebRole::Manage[XPHEnum::Value].' and status='.FeedBackStatus::ToAudit[XPHEnum::Value].' and belong=0 and del_flag='.CommonStatus::UnDeleted[XPHEnum::Value]." group by role_id ");
				// pri($feedback_list);

				$data['feedbackcountTeacher']=$this->Supervisor_feedback_model->query('select count(*)as count from(select * from db_student_feedback union all select * from db_supervisor_feedback) feedback where role_belong='.WebRole::Manage[XPHEnum::Value].' and status='.FeedBackStatus::ToAudit[XPHEnum::Value].' and belong='.getSess()['id'].' and del_flag='.CommonStatus::UnDeleted[XPHEnum::Value]);
				// pri($data);
				$feedback_list_1=$this->Supervisor_feedback_model->query('select * from(SELECT db_student_feedback.*,a.role_id,a.sub_role_id FROM db_student_feedback LEFT JOIN db_admin a on a.id = db_student_feedback.creator UNION ALL SELECT db_supervisor_feedback.*,a1.role_id,a1.sub_role_id FROM db_supervisor_feedback LEFT JOIN db_admin a1 on a1.id = db_supervisor_feedback.creator) feedback where role_belong='.WebRole::Manage[XPHEnum::Value].' and status='.FeedBackStatus::ToAudit[XPHEnum::Value].' and belong='.getSess()['id'].' and del_flag='.CommonStatus::UnDeleted[XPHEnum::Value]." group by feedback.role_id "); 

			}else if(in_array(WebRole::UnitSupervisorGroupLeader[XPHEnum::Value],$role)){ // 5
				
				$data['feedbackcount']=$this->Supervisor_feedback_model->query('select count(*)as count from(select * from db_student_feedback union all select * from db_supervisor_feedback) feedback LEFT JOIN db_admin a1 on a1.id=feedback.creator where feedback.status='.FeedBackStatus::ToAudit[XPHEnum::Value].' and a1.dept_name="'.getSess()['dept_name'].'" and role_belong='.WebRole::UnitSupervisorGroupLeader[XPHEnum::Value].' and del_flag='.CommonStatus::UnDeleted[XPHEnum::Value].' and belong=0');

			//	pri($data['feedbackcount']);

				$feedback_list = $this->Supervisor_feedback_model->query('select * from(SELECT db_student_feedback.*,a.role_id,a.sub_role_id FROM db_student_feedback LEFT JOIN db_admin a on a.id = db_student_feedback.creator UNION ALL SELECT db_supervisor_feedback.*,a1.role_id,a1.sub_role_id FROM db_supervisor_feedback LEFT JOIN db_admin a1 on a1.id = db_supervisor_feedback.creator) feedback LEFT JOIN db_admin a1 on a1.id=feedback.creator where feedback.status='.FeedBackStatus::ToAudit[XPHEnum::Value].' and a1.dept_name="'.getSess()['dept_name'].'" and role_belong='.WebRole::UnitSupervisorGroupLeader[XPHEnum::Value].' and del_flag='.CommonStatus::UnDeleted[XPHEnum::Value].' and belong=0  group by feedback.role_id ');

				$data['feedbackcountTeacher']=$this->Supervisor_feedback_model->query('select count(*)as count from(select * from db_student_feedback union all select * from db_supervisor_feedback) feedback LEFT JOIN db_admin a1 on a1.id=feedback.creator where feedback.status='.FeedBackStatus::ToAudit[XPHEnum::Value].' and a1.dept_name="'.getSess()['dept_name'].'" and role_belong='.WebRole::UnitSupervisorGroupLeader[XPHEnum::Value].' and del_flag='.CommonStatus::UnDeleted[XPHEnum::Value].' and belong='.getSess()['id']);			

				$feedback_list_1=$this->Supervisor_feedback_model->query('select * from(SELECT db_student_feedback.*,a.role_id,a.sub_role_id FROM db_student_feedback LEFT JOIN db_admin a on a.id = db_student_feedback.creator UNION ALL SELECT db_supervisor_feedback.*,a1.role_id,a1.sub_role_id FROM db_supervisor_feedback LEFT JOIN db_admin a1 on a1.id = db_supervisor_feedback.creator) feedback LEFT JOIN db_admin a1 on a1.id=feedback.creator where feedback.status='.FeedBackStatus::ToAudit[XPHEnum::Value].' and a1.dept_name="'.getSess()['dept_name'].'" and role_belong='.WebRole::UnitSupervisorGroupLeader[XPHEnum::Value].' and del_flag='.CommonStatus::UnDeleted[XPHEnum::Value].' and belong='.getSess()['id']);	

			}else{
			
				$data['feedbackcount']=$this->Supervisor_feedback_model->query('select count(*)as count from(select * from db_student_feedback union all select * from db_supervisor_feedback) feedback where belong='.getSess()['id'].' and status='.FeedBackStatus::ToAudit[XPHEnum::Value].' and belong=0 and  del_flag='.CommonStatus::UnDeleted[XPHEnum::Value]);
				//pri($data['feedbackcount']);

				$feedback_list = $this->Supervisor_feedback_model->query('select * from(SELECT db_student_feedback.*,a.role_id,a.sub_role_id FROM db_student_feedback LEFT JOIN db_admin a on a.id = db_student_feedback.creator UNION ALL SELECT db_supervisor_feedback.*,a1.role_id,a1.sub_role_id FROM db_supervisor_feedback LEFT JOIN db_admin a1 on a1.id = db_supervisor_feedback.creator) feedback where belong='.getSess()['id'].' and status='.FeedBackStatus::ToAudit[XPHEnum::Value].' and belong=0 and  del_flag='.CommonStatus::UnDeleted[XPHEnum::Value]." group by feedback.role_id ");

				$data['feedbackcountTeacher']=$this->Supervisor_feedback_model->query('select count(*)as count from(select * from db_student_feedback union all select * from db_supervisor_feedback) feedback where belong='.getSess()['id'].' and status='.FeedBackStatus::ToAudit[XPHEnum::Value].' and belong='.getSess()['id'].' and  del_flag='.CommonStatus::UnDeleted[XPHEnum::Value]);
				
				$feedback_list_1= $this->Supervisor_feedback_model->query('select * from(SELECT db_student_feedback.*,a.role_id,a.sub_role_id FROM db_student_feedback LEFT JOIN db_admin a on a.id = db_student_feedback.creator UNION ALL SELECT db_supervisor_feedback.*,a1.role_id,a1.sub_role_id FROM db_supervisor_feedback LEFT JOIN db_admin a1 on a1.id = db_supervisor_feedback.creator) feedback where belong='.getSess()['id'].' and status='.FeedBackStatus::ToAudit[XPHEnum::Value].' and belong='.getSess()['id'].' and  del_flag='.CommonStatus::UnDeleted[XPHEnum::Value]." group by feedback.role_id ");
			}
		// }
		
		
		
		$role=explode(',',getSess()['sub_role_id']);
		array_push($role,getSess()['role_id']);
		$data['role']='';
		foreach ($role as $k => $v) {
			$data['role'].=(new WebRole)->show($v).'  ';
		}

		$feedback_rold_id = array_column($feedback_list,'role_id');
		$feedback_sub_rold_id = array_column($feedback_list,'sub_role_id');
		$feedback_sub_rold_id = implode(',',$feedback_sub_rold_id);
		$feedback_sub_rold_id = explode(',',$feedback_sub_rold_id);
		foreach ($feedback_rold_id as $k => $v) {
		  array_push($feedback_sub_rold_id,$v);
		}

		$feedback_rold_id_1 = array_column($feedback_list_1,'role_id');
		$feedback_sub_rold_id_1= array_column($feedback_list_1,'sub_role_id');
		$feedback_sub_rold_id_1 = implode(',',$feedback_sub_rold_id_1);
		$feedback_sub_rold_id_1 = explode(',',$feedback_sub_rold_id_1);
		foreach ($feedback_rold_id_1 as $k1 => $v1) {
		  array_push($feedback_sub_rold_id_1,$v1);
		}

		//pri($feedback_sub_rold_id);
	//	pri($feedback_list);
	   if(in_array(WebRole::SchoolSupervisor[XPHEnum::Value],$feedback_sub_rold_id_1) || in_array(WebRole::UnitSupervisorGroupLeader[XPHEnum::Value],$feedback_sub_rold_id_1)||in_array(WebRole::UnitSupervisor[XPHEnum::Value],$feedback_sub_rold_id_1)||in_array(WebRole::SupervisorDirector[XPHEnum::Value],$feedback_sub_rold_id_1)||in_array(WebRole::OutsideSupervisor[XPHEnum::Value],$feedback_sub_rold_id_1)){
			$data['href_teacher']='Admin/FeedBack/IndexTeacher?type=Supervisor';		
		}elseif(in_array(WebRole::Student[XPHEnum::Value],$feedback_sub_rold_id_1) || in_array(WebRole::StudentInfoOfficer[XPHEnum::Value],$feedback_sub_rold_id_1) || in_array(WebRole::UnitStudentInfoOfficer[XPHEnum::Value],$feedback_sub_rold_id_1)){
			$data['href_teacher']='Admin/FeedBack/IndexTeacher?type=Student';				
		}else{
			$data['href_teacher']='Admin/FeedBack/IndexTeacher';
		}
		//$data['href_teacher']='Admin/FeedBack/IndexTeacher';
		$data['href_teacher_title']='督导反馈管理(转发个人)';


		if(in_array(WebRole::Manage[XPHEnum::Value],$role)){
			if(in_array(WebRole::SchoolSupervisor[XPHEnum::Value],$feedback_sub_rold_id) || in_array(WebRole::UnitSupervisorGroupLeader[XPHEnum::Value],$feedback_sub_rold_id)||in_array(WebRole::UnitSupervisor[XPHEnum::Value],$feedback_sub_rold_id)||in_array(WebRole::SupervisorDirector[XPHEnum::Value],$feedback_sub_rold_id)||in_array(WebRole::OutsideSupervisor[XPHEnum::Value],$feedback_sub_rold_id)){
				$data['href']='Admin/FeedBack/IndexManage?type=Supervisor';		
			}elseif(in_array(WebRole::Student[XPHEnum::Value],$feedback_sub_rold_id) || in_array(WebRole::StudentInfoOfficer[XPHEnum::Value],$feedback_sub_rold_id) || in_array(WebRole::UnitStudentInfoOfficer[XPHEnum::Value],$feedback_sub_rold_id)){
				$data['href']='Admin/FeedBack/IndexManage?type=Student';				
			}else{
				$data['href']='Admin/FeedBack/IndexManage?type=Supervisor';	
			}		
			$data['href_title']='督导反馈管理(管理员)';
		}else if(in_array(WebRole::UnitSupervisorGroupLeader[XPHEnum::Value],$role)){
			if(in_array(WebRole::SchoolSupervisor[XPHEnum::Value],$feedback_sub_rold_id) || in_array(WebRole::UnitSupervisorGroupLeader[XPHEnum::Value],$feedback_sub_rold_id)||in_array(WebRole::UnitSupervisor[XPHEnum::Value],$feedback_sub_rold_id)||in_array(WebRole::SupervisorDirector[XPHEnum::Value],$feedback_sub_rold_id)||in_array(WebRole::OutsideSupervisor[XPHEnum::Value],$feedback_sub_rold_id)){
				$data['href']='Admin/FeedBack/IndexUnitSupervisorGroupLeader?type=Supervisor';		
			}elseif(in_array(WebRole::Student[XPHEnum::Value],$feedback_sub_rold_id) || in_array(WebRole::StudentInfoOfficer[XPHEnum::Value],$feedback_sub_rold_id) || in_array(WebRole::UnitStudentInfoOfficer[XPHEnum::Value],$feedback_sub_rold_id)){
				$data['href']='Admin/FeedBack/IndexUnitSupervisorGroupLeader?type=Student';				
			}else{
				$data['href']='Admin/FeedBack/IndexUnitSupervisorGroupLeader?type=Supervisor';		
			}
			//$data['href']='Admin/FeedBack/IndexUnitSupervisorGroupLeader';
			$data['href_title']='督导反馈管理(二级教学单位督导组长)';
		}else if(in_array(WebRole::SupervisorDirector[XPHEnum::Value],$role)){
			if(in_array(WebRole::SchoolSupervisor[XPHEnum::Value],$feedback_sub_rold_id) || in_array(WebRole::UnitSupervisorGroupLeader[XPHEnum::Value],$feedback_sub_rold_id)||in_array(WebRole::UnitSupervisor[XPHEnum::Value],$feedback_sub_rold_id)||in_array(WebRole::SupervisorDirector[XPHEnum::Value],$feedback_sub_rold_id)||in_array(WebRole::OutsideSupervisor[XPHEnum::Value],$feedback_sub_rold_id)){
				$data['href']='Admin/FeedBack/IndexSupervisorDirector?type=Supervisor';		
			}elseif(in_array(WebRole::Student[XPHEnum::Value],$feedback_sub_rold_id) || in_array(WebRole::StudentInfoOfficer[XPHEnum::Value],$feedback_sub_rold_id) || in_array(WebRole::UnitStudentInfoOfficer[XPHEnum::Value],$feedback_sub_rold_id)){
				$data['href']='Admin/FeedBack/IndexSupervisorDirector?type=Student';				
			}else{
				$data['href']='Admin/FeedBack/IndexSupervisorDirector?type=Supervisor';	
			}
			//$data['href']='Admin/FeedBack/IndexSupervisorDirector';
			$data['href_title']='督导反馈管理(督导处长)';
		}else if(in_array(WebRole::SchoolLeader[XPHEnum::Value],$role)){
			if(in_array(WebRole::SchoolSupervisor[XPHEnum::Value],$feedback_sub_rold_id) || in_array(WebRole::UnitSupervisorGroupLeader[XPHEnum::Value],$feedback_sub_rold_id)||in_array(WebRole::UnitSupervisor[XPHEnum::Value],$feedback_sub_rold_id)||in_array(WebRole::SupervisorDirector[XPHEnum::Value],$feedback_sub_rold_id)||in_array(WebRole::OutsideSupervisor[XPHEnum::Value],$feedback_sub_rold_id)){
				$data['href']='Admin/FeedBack/IndexSchoolLeader?type=Supervisor';		
			}elseif(in_array(WebRole::Student[XPHEnum::Value],$feedback_sub_rold_id) || in_array(WebRole::StudentInfoOfficer[XPHEnum::Value],$feedback_sub_rold_id) || in_array(WebRole::UnitStudentInfoOfficer[XPHEnum::Value],$feedback_sub_rold_id)){
				$data['href']='Admin/FeedBack/IndexSchoolLeader?type=Student';				
			}else{
				$data['href']='Admin/FeedBack/IndexSchoolLeader?type=Supervisor';	
			}
			//$data['href']='Admin/FeedBack/IndexSchoolLeader';
			$data['href_title']='督导反馈管理(校领导)';
		}else {
			$data['href']=null;			
		}	
		if(in_array(WebRole::UnitSupervisorGroupLeader[XPHEnum::Value],$role) && in_array(WebRole::UnitLeader[XPHEnum::Value],$role) && (!in_array(WebRole::Student[XPHEnum::Value],$role)&& !in_array(WebRole::SchoolSupervisor[XPHEnum::Value],$role)&& !in_array(WebRole::UnitSupervisor[XPHEnum::Value],$role)&& !in_array(WebRole::ExternalSupervisor[XPHEnum::Value],$role)&& !in_array(WebRole::StudentInfoOfficer[XPHEnum::Value],$role)&& !in_array(WebRole::UnitStudentInfoOfficer[XPHEnum::Value],$role)&& !in_array(WebRole::SupervisorDirector[XPHEnum::Value],$role)&& !in_array(WebRole::SchoolLeader[XPHEnum::Value],$role)&& !in_array(WebRole::Manage[XPHEnum::Value],$role)&& !in_array(WebRole::OutsideSupervisor[XPHEnum::Value],$role) && !in_array(WebRole::MajorUnitLeader[XPHEnum::Value],$role))){
				$data['href']=null;			
			}

			//去掉重复课程
			/* $sql ="SELECT
				*,
				COUNT(*) 
			FROM
				db_class 
			WHERE
				id > 129146 and elective_lesson_no = '(2023-2024-2)'
			GROUP BY
				`db_class`.`name`,
				db_class.teacher_id,
				`db_class`.`code`, 
				`db_class`.`start_time`, 
				`db_class`.`end_time`, 
				`db_class`.`course_units`, 
				`db_class`.`type`, 
				db_class.classroom,
				db_class.classname,
				db_class.sksj 
			HAVING
				COUNT(*) > 1;";
			$dd =	$this->Supervisor_feedback_model->query($sql);
			foreach($dd as $k=>$v){
				$sql1 = "select * from db_class where code = '".$v['code']."' and name= '".$v['name']."' and  elective_lesson_no ='".$v['elective_lesson_no']."'
				 and start_time ='".$v['start_time']."' and end_time='".$v['end_time']."' and teacher_id='".$v['teacher_id']."' and course_units = '".$v['course_units']."' 
				 and classroom ='".$v['classroom']."' and classname ='".$v['classname']."' and type = '".$v['type']."' and sksj='".$v['sksj']."' order by id asc";
				 $dd1 =	$this->Supervisor_feedback_model->query($sql1);
				//  $minId = $dd1[0]['id'];
				$idlist = array_column($dd1,"id");
				unset($idlist[0]);
				$idlist = array_values($idlist);
				
				 $sql2 = " delete from db_class where id  in (".implode(",",$idlist).")";
				$this->Supervisor_feedback_model->execute($sql2);
			} */
			// var_dump($dd);

		
		$this->load->view('admin/desktop',$data);
	}
	
	
	function test(){
		$this->load->library('ProjectService/attend_service');
		$result=$this->attend_service->getAttendData(0,1,getSess(SESS_USER)['id']);
		// $result=$this->attend_service->getAttendData(1);
		var_dump($result);
		exit();
	}
	function saveTest(){
		$param=array(
			'attend'=>array(
				'class_id'=>1,
				'listen_id'=>getSess()['id'],
				'type'=>AttendType::School[XPHEnum::Value],
				'serial_no'=>111112232,
				'academic_year'=>1,
				'semester'=>2,
				'class_name'=>'class_name',
				'class_type'=>'基础课',
				'teacher_name'=>'战三',
				'title'=>'副高',
				'dept_name'=>'人事部',
				'age_groups'=>'亲年',
				'teachers_attribute'=>'专业教师',
				'listen_name'=>'李四',
				'listen_time'=>'2019-01-02',
				'listen_address'=>'sadfsf',
				'course_units'=>'asd',
				'listen_class'=>'1班',
				// 'classroom_facilities'=>'好',
				// 'classroom_environmental'=>'好',
				'advice'=>'意见',
				'teaching_level_score'=>'60',
				'teaching_effect_score'=>'80'
				),
			'attend_teaching_content'=>array(
				0=>array('content'=>'asdasd','score'=>10,'get_score'=>8),
				1=>array('content'=>'asdasd','score'=>10,'get_score'=>5),
				2=>array('content'=>'asdasd','score'=>10,'get_score'=>6)
				),
			'attend_teaching_implementation'=>array(
				0=>array('content'=>'asdasd','score'=>15,'get_score'=>7),
				1=>array('content'=>'asdasd','score'=>15,'get_score'=>5),
				2=>array('content'=>'asdasd','score'=>15,'get_score'=>4)
				),
			'attend_teaching_level'=>array(
				0=>array('item'=>'A','remark'=>'level_mark1','is_check'=>1),
				1=>array('item'=>'B','remark'=>'level_mark2','is_check'=>0),
				2=>array('item'=>'C','remark'=>'level_mark3','is_check'=>0)
				),
			'attend_student_status'=>array(
				0=>array('content'=>'asdasd','score'=>20,'get_score'=>15),
				1=>array('content'=>'asdasd','score'=>20,'get_score'=>10),
				2=>array('content'=>'asdasd','score'=>20,'get_score'=>9)
				),
			'attend_teaching_effect'=>array(
				0=>array('item'=>'A','remark'=>'effect_mark1','is_check'=>0),
				1=>array('item'=>'B','remark'=>'effect_mark2','is_check'=>1),
				2=>array('item'=>'C','remark'=>'effect_mark3','is_check'=>0)
				),
			'attend_teaching_readiness'=>array(
				0=>array('item'=>'课程标准','option'=>'有,无','check_value'=>'有'),
				1=>array('item'=>'整体设计','option'=>'有,无','check_value'=>'无'),
				2=>array('item'=>'单元设计','option'=>'是,否','check_value'=>'否')
				),
			'attend_students_norm'=>array(
				0=>array('item'=>'应到人数','check_value'=>'22'),
				1=>array('item'=>'实到人数','check_value'=>'44'),
				2=>array('item'=>'按时到课人数','check_value'=>'33')
				),
			'attend_classroom_facilities'=>array('option'=>'好,不好','check_value'=>'不好'),
			'attend_classroom_environmental'=>array('option'=>'好,一般,差','check_value'=>'一般'),
			'attend_record'=>array(
				0=>array('time'=>'time1','activity'=>'activity1','commentary'=>'commentary1'),
				0=>array('time'=>'time2','activity'=>'activity2','commentary'=>'commentary2'),
				0=>array('time'=>'time3','activity'=>'activity3','commentary'=>'commentary3')
				),
			'attend_img'=>array(
				0=>array('img'=>'http://www.baidu.com'),
				1=>array('img'=>'http://www.sina.com')
				)
			);
		$this->load->library('ProjectService/attend_service');
		$result=$this->attend_service->saveAttend($param);
		var_dump($result);
		exit();
	}

	function editTest(){
		$param=array(
			'attend'=>array(
				'class_id'=>1,
				'listen_id'=>getSess()['id'],
				'type'=>AttendType::School[XPHEnum::Value],
				'serial_no'=>111112232,
				'academic_year'=>1,
				'semester'=>2,
				'class_name'=>'class_name',
				'class_type'=>'基础课',
				'teacher_name'=>'战三111111111111111111111',
				'title'=>'副高',
				'dept_name'=>'人事部',
				'age_groups'=>'亲年',
				'teachers_attribute'=>'专业教师',
				'listen_name'=>'李四',
				'listen_time'=>'2019-01-02',
				'listen_address'=>'sadfsf',
				'course_units'=>'asd',
				'listen_class'=>'1班',
				// 'classroom_facilities'=>'好',
				// 'classroom_environmental'=>'好',
				'advice'=>'意见',
				'teaching_level_score'=>'60',
				'teaching_effect_score'=>'80'
				),
			'attend_teaching_content'=>array(
				0=>array('content'=>'asdasd','score'=>10,'get_score'=>8),
				1=>array('content'=>'asdasd','score'=>10,'get_score'=>5),
				2=>array('content'=>'asdasd','score'=>10,'get_score'=>99)
				),
			'attend_teaching_implementation'=>array(
				0=>array('content'=>'asdasd','score'=>15,'get_score'=>7),
				1=>array('content'=>'asdasd','score'=>15,'get_score'=>5),
				2=>array('content'=>'asdasd','score'=>15,'get_score'=>4)
				),
			'attend_teaching_level'=>array(
				0=>array('item'=>'A','remark'=>'level_mark1','is_check'=>1),
				1=>array('item'=>'B','remark'=>'level_mark2','is_check'=>0),
				2=>array('item'=>'C','remark'=>'level_mark3','is_check'=>0)
				),
			'attend_student_status'=>array(
				0=>array('content'=>'asdasd','score'=>20,'get_score'=>15),
				1=>array('content'=>'asdasd','score'=>20,'get_score'=>10),
				2=>array('content'=>'asdasd','score'=>20,'get_score'=>9)
				),
			'attend_teaching_effect'=>array(
				0=>array('item'=>'A','remark'=>'effect_mark1','is_check'=>0),
				1=>array('item'=>'B','remark'=>'effect_mark2','is_check'=>1),
				2=>array('item'=>'C','remark'=>'effect_mark3','is_check'=>0)
				),
			'attend_teaching_readiness'=>array(
				0=>array('item'=>'课程标准','option'=>'有,无','check_value'=>'有'),
				1=>array('item'=>'整体设计','option'=>'有,无','check_value'=>'无'),
				2=>array('item'=>'单元设计','option'=>'是,否','check_value'=>'否')
				),
			'attend_students_norm'=>array(
				0=>array('item'=>'应到人数','check_value'=>'22'),
				1=>array('item'=>'实到人数','check_value'=>'44'),
				2=>array('item'=>'按时到课人数','check_value'=>'98')
				),
			'attend_classroom_facilities'=>array('option'=>'好,不好','check_value'=>'好'),
			'attend_classroom_environmental'=>array('option'=>'好,一般,差','check_value'=>'差'),
			'attend_record'=>array(
				0=>array('time'=>'time1','activity'=>'activity1','commentary'=>'commentary1'),
				1=>array('time'=>'time2','activity'=>'activity2','commentary'=>'commentary2'),
				2=>array('time'=>'time3','activity'=>'activity3','commentary'=>'commentary3')
				),
			'attend_img'=>array(
				0=>array('img'=>'http://www.baidu.com'),
				1=>array('img'=>'http://www.sina.com')
				)
			);
		$this->load->library('ProjectService/attend_service');
		$result=$this->attend_service->saveAttend($param,1);
		var_dump($result);
		exit();
	}




	function feedbackSave(){
		$this->load->library('ProjectService/feedback_service');
		$param=array(
			'type'=>SupervisorFeedbackType::School[XPHEnum::Value],
            'creator'=>getSess()['id'],
	        'content'=>'这是测试的反馈意见',
	        'dept_name'=>'分院',
	        'class_name'=>'班级',
	        'img'=>array(
	        	'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=3300305952,1328708913&fm=27&gp=0.jpg',
	        	'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1718395925,3485808025&fm=27&gp=0.jpg'
	        	)
			);
		$result=$this->feedback_service->saveFeedBack(FeedbackType::Supervisor[XPHEnum::Value],$param);
		var_dump($result);
		exit();
	}
	function feedbackSave2(){
		$this->load->library('ProjectService/feedback_service');
		$param=array(
			'type'=>StudentFeedbackType::Secondary[XPHEnum::Value],
            'creator'=>getSess()['id'],
	        'content'=>'这是测试的反馈意见',
	        'dept_name'=>'分院',
	        'class_name'=>'班级',
	        'img'=>array(
	        	'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=3300305952,1328708913&fm=27&gp=0.jpg',
	        	'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1718395925,3485808025&fm=27&gp=0.jpg'
	        	)
			);
		$result=$this->feedback_service->saveFeedBack(FeedbackType::Student[XPHEnum::Value],$param);
		var_dump($result);
		exit();
	}
	function feedbackSubmit(){
		$this->load->library('ProjectService/feedback_service');
		$result=$this->feedback_service->submitToManage(FeedbackType::Student[XPHEnum::Value],1);
		var_dump($result);
		exit();
	}
	function feedbackAssign(){
		$this->load->library('ProjectService/feedback_service');
		$result=$this->feedback_service->assignDealAdmin(FeedbackType::Supervisor[XPHEnum::Value],1,5);
		var_dump($result);
		exit();
	}
	function feedbackWrite(){
		$this->load->library('ProjectService/feedback_service');
		$result=$this->feedback_service->writeResult(FeedbackType::Supervisor[XPHEnum::Value],1,'这是处理意见');
		var_dump($result);
		exit();
	}
	function feedbackEnd(){
		$this->load->library('ProjectService/feedback_service');
		$result=$this->feedback_service->endFeedBack(FeedbackType::Supervisor[XPHEnum::Value],1);
		var_dump($result);
		exit();
	}



	function announcementGet(){
		$this->load->library('ProjectService/announcement_service');
		$result=$this->announcement_service->getAnnouncementByAdminId(getSess()['id']);
		var_dump($result);
		exit();
	}

}
